<template>
  <div class="row justify-content-center">
    <div class="col-8">
      <div v-if="student">
        <h2 class="jh-entity-heading" data-cy="studentDetailsHeading"><span>Student</span> {{ student.id }}</h2>
        <dl class="row jh-entity-details">
          <dt>
            <span>Student Number</span>
          </dt>
          <dd>
            <span>{{ student.studentNumber }}</span>
          </dd>
          <dt>
            <span>Student Name</span>
          </dt>
          <dd>
            <span>{{ student.studentName }}</span>
          </dd>
          <dt>
            <span>Student Status</span>
          </dt>
          <dd>
            <span>{{ student.studentStatus }}</span>
          </dd>
          <dt>
            <span>Student Password</span>
          </dt>
          <dd>
            <span>{{ student.studentPassword }}</span>
          </dd>
          <dt>
            <span>Student Sex</span>
          </dt>
          <dd>
            <span>{{ student.studentSex }}</span>
          </dd>
          <dt>
            <span>Address</span>
          </dt>
          <dd>
            <span>{{ student.address }}</span>
          </dd>
          <dt>
            <span>User Class</span>
          </dt>
          <dd>
            <span v-for="(userClass, i) in student.userClasses" :key="userClass.id"
              >{{ i > 0 ? ', ' : '' }}
              <router-link :to="{ name: 'UserClassView', params: { userClassId: userClass.id } }">{{ userClass.id }}</router-link>
            </span>
          </dd>
        </dl>
        <button type="submit" v-on:click.prevent="previousState()" class="btn btn-info" data-cy="entityDetailsBackButton">
          <font-awesome-icon icon="arrow-left"></font-awesome-icon>&nbsp;<span> Back</span>
        </button>
        <router-link v-if="student.id" :to="{ name: 'StudentEdit', params: { studentId: student.id } }" custom v-slot="{ navigate }">
          <button @click="navigate" class="btn btn-primary">
            <font-awesome-icon icon="pencil-alt"></font-awesome-icon>&nbsp;<span> Edit</span>
          </button>
        </router-link>
      </div>
    </div>
  </div>
</template>

<script lang="ts" src="./student-details.component.ts"></script>
